from langchain_openai import AzureChatOpenAI
from langchain_core.messages import HumanMessage, SystemMessage
from dotenv import load_dotenv

import os
load_dotenv()

os.environ["AZURE_OPENAI_ENDPOINT"] = "https://chatgpt-test-0001.openai.azure.com/"
os.environ["AZURE_OPENAI_API_KEY"] = "90643b9c4bee421bba17d72b748ad446"


llmchat = AzureChatOpenAI(
    azure_deployment="testMini",  # or your deployment
    api_version="2024-06-01",  # or your api version
    temperature=0,
    max_tokens=None,
    timeout=None,
    max_retries=2,
    # other params...
)
print(llmchat([HumanMessage(content="写一首情诗")]).content)